/*
 * 上海远境文化传媒有限公司 版权所有
 */
package facade.open.response.base;

import models.base.AdminRoleOperate;
import models.base.Role;

import java.util.Date;
import java.util.List;

/**
 * 角色Response
 */
public class RoleResponse {

    /**
     * ID.
     */
    public String id;

    /**
     * 角色名.
     */
    public String name;

    /**
     * 备注.
     */
    public String remark;

    /**
     * 显示顺序.
     */
    public Integer showOrder;

    /**
     * 创建时间.
     */
    public Date createdAt;

    /**
     * 更新时间.
     */
    public Date modifyAt;

    /**
     * 操作业务
     */
    public List<AdminRoleOperate> businessList;


    public static RoleResponse from(Role role) {
        RoleResponse response = new RoleResponse();
        response.id = role.id;
        response.name = role.name;
        response.showOrder = role.showOrder;
        response.remark = role.remark;
        response.createdAt = role.createdAt;
        response.modifyAt = role.modifyAt;
        return response;
    }
}
